package way;

import java.util.Scanner;

public class EveryAdd {
    public static int add(int n) {
        if (n < 10) {
            return n;
        }
        return n % 10 + add(n / 10);
    }

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        System.out.println(add(n));
    }
}
